﻿@if (pieData == null)
{
	<Loading></Loading>
}
else
{
	<Pie Data="pieData" Config="config" />
}



@code {
	public class PieData
	{
		public string type;
		public int value;
	}
	[Parameter]
	public object[] pieData{ get; set; }
	public PieConfig pieConfig;
	[Parameter]
	public int height { get; set; }
	[Parameter]
	public int width { get; set; }
	protected override void OnParametersSet()
	{
		config.Height = height;
		config.Width = width;
		base.OnParametersSet();
	}
	readonly PieConfig config = new PieConfig
    {
            AutoFit = true,
            Radius = 1,
			InnerRadius=0.6,
            AngleField = "value",
            ColorField = "type",
            Label = new PieLabelConfig
            {
                Visible = true,
                Type = "inner"
            }
    };

}
